package com.xiangxiangjd.aircraftanalysis;

import com.xiangxiangjd.aircraftanalysis.config.token.JwtUtils;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.io.IOException;

@MapperScan({"com.xiangxiangjd.aircraftanalysis.mapper"})
//扫描公共模块下的包     注入注解
@ComponentScan(basePackages = {"com.xiangxiangjd.aircraftanalysis"})
//@ServletComponentScan(value = "com.xiangxiangjd.aircraftanalysis.config")
@SpringBootApplication
//启动缓存数据库
@EnableCaching
@EnableScheduling  //定时任务
@EnableAsync
@Slf4j
//@EnableConfigurationProperties({Path.class})
public class AircraftAnalysisApplication {






    public static void main(String[] args) {



        log.info("Springboot启动中...." );
        ConfigurableApplicationContext context = SpringApplication.run(AircraftAnalysisApplication.class, args);
        log.info("启动成功！");
//        Environment environment = context.getBean(Environment.class);
//        try {
//            System.out.println("谷歌的路径:"+Path.chrome);
//
//            Runtime.getRuntime().exec(Path.chrome+" http://localhost:" + environment.getProperty("server.port")+"/index.html");
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
    }

    //     注入值
    @Bean
    public JwtUtils jwtUtils() {
        return new JwtUtils();
    }




}
